#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#define int long long
using namespace std;
 
void solve()
{
	int n; cin >> n;
	map<int, int> hash;
	while (n--)
	{
		int tmp; cin >> tmp;
		hash[tmp]++;
	}
	cout << hash.size() << endl;
}
 
signed main()
{
	int t; cin >> t;
	while (t--) solve();
	return 0;
}